<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%-- <%@ include file="b.jsp" %> --%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<%
	int a = 10;
	System.out.println(a);
%>

<!-- 输出表达式 -->
<p>
	今天的日期是:<%= (new java.util.Date()).toLocaleString() %>
</p>

<!--  -->
<%!
	String name = "zs";
	public int add(int num1, int num2) {
		return num1 + num2;
	}
%>

<%
	pageContext.setAttribute("pKey", "pVal");
	request.setAttribute("rKey", "rVal");
	session.setAttribute("sKey", "sVal");
/* 	application.setAttribute("aKey", "aVal"); */
/* 若key重名了使用getAtrribute会取哪一个key值 */
	application.setAttribute("sKey", "aVal");
%>


<p><a href="b.jsp">到b.jsp</a></p>

<p>
	page :<%= pageContext.getAttribute("pKey") %>
	<br>
	request :<%= request.getAttribute("rKey") %>
	<br>
	session :<%= session.getAttribute("sKey") %>
	<br>
	application :<%= 
	/* application.getAttribute("aKey")  */
	application.getAttribute("sKey") 
	%>
	<br>
</p>
</body>
</html>